<!DOCTYPE HTML>
<html> 
<head>
	<meta charset="utf-8">
	<title>动作管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<#include "../../include/layui.ftl" />
	<#include "../../include/pTable.ftl" />
</head>
<body>

<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-form layui-card-header layuiadmin-card-header-auto">
			<form  id="queryForm">
				<input type="hidden" id="className" name="className" value="${className!}" />
				<input type="hidden" id="modleName" name="modleName" value="${modleName!}" />
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">动作编码</label>
						<div class="layui-input-block">
							<input type="text" name="motionCode" placeholder="请输入" autocomplete="off" class="layui-input">
							<input type="hidden" name="motionCode_searchType" value="eq">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">动作名称</label>
						<div class="layui-input-block">
							<input type="text" name="motionName" placeholder="请输入" autocomplete="off" class="layui-input">
							<input type="hidden" name="motionName_searchType" value="like">
						</div>
					</div>
				</div>
			</form>
		</div>

		<div class="layui-card-body">
			<table id="lay-table" lay-filter="lay-table"></table>
			<script type="text/html" id="toolbar"></script>
		</div>
	</div>
</div>
<script>
	layui.config({
		base: '${path}/plug-in/layuiadmin/' //静态资源所在路径
	}).extend({
		index: 'lib/index' //主入口模块
	}).use(['index','tables','layers'],function () {
		var tables = layui.tables,
				$ = layui.$,
				layers = layui.layers,
				table = layui.table;
		var parmer = {
			cols:[[
				{type:'numbers'}
				,{field:"motionCode",width:120,title:"动作编码"}
				,{field:"motionName",width:120,title:"动作名称"}
				,{field:"motionIcon",width:120,title:"动作css"}
				,{field:"motionIcon_",width:120,title:"动作预览",templet:function (d) {
					return '<a class="layui-btn layui-btn-xs">'+ d.motionName +'</a>';
					}}
				,{field:"motionOrder",width:120,title:"动作排序"}
			]]
		};
		var $tables = tables.renderTable(parmer);

		//头工具栏事件
		table.on('toolbar(lay-table)', function(obj){
			switch(obj.event){
				case '01':
					layers.add({area:['400px', '375px']});
					break;
				case '02':
					layers.edit({
						area:['400px', '375px'],
						data:p.data
					});
					break;
				case '03':
					layers.delete({data: p.data});
					break;
				case '05':
					var where = $("#queryForm").serializeObject();
					$tables.reload({
						where: where,
						text: {none: '暂无数据！'}
					});
					break;
			};
		});
	});
</script>
</body>
</html>